package com.zsck.pos.adapter;


import android.text.TextUtils;

import androidx.lifecycle.Observer;

import com.chad.library.adapter.base.BaseNodeAdapter;
import com.chad.library.adapter.base.entity.node.BaseNode;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.zsck.pos.bean.BatchBills;
import com.zsck.pos.bean.FeeVOListBean;
import com.zsck.pos.bean.MonthBill;
import com.zsck.pos.bean.SecondLiveEvent;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class MultiBillsAdapter extends BaseNodeAdapter implements LoadMoreModule {

    private BaseNode node;

    public MultiBillsAdapter() {
        super();
        FirstProjectAdapter firstProjectAdapter = new FirstProjectAdapter();
        SecondMonthAdapter secondMonthAdapter = new SecondMonthAdapter();
        ThirdFeeAdapter thirdFeeAdapter = new ThirdFeeAdapter();
        addNodeProvider(firstProjectAdapter);
        addNodeProvider(secondMonthAdapter);
        addNodeProvider(thirdFeeAdapter);

    }

    @Override
    protected int getItemType(@NotNull List<? extends BaseNode> data, int position) {
        node = data.get(position);
        if (node instanceof BatchBills) {
            return 1;
        } else if (node instanceof MonthBill) {
            return 2;
        } else if (node instanceof FeeVOListBean) {
            return 3;
        }

        return -1;
    }

    public static final int EXPAND_COLLAPSE_PAYLOAD = 110;

}
